<!DOCTYPE html>
<html>
<head>
  <title>Welcome to Vue</title>
  <script src="https://cdn.bootcss.com/vue/2.4.2/vue.js"></script>
  <script src="https://cdn.bootcss.com/axios/0.16.2/axios.js"></script>
</head>
<body>
<div id="app"></div>

<script>
  new Vue({
    el: '#app',
    data: {

    },
    mounted(){
      this.updateMealOrderByDeskId()
    },
    methods: {
      updateMealOrderByDeskId(){
        let mealOrderFoodsArr = [];
        for (var i=0;i<3;i++){
            var mealOrderFood={
              food_id:'1',
              num:1,
              food_taste:'辣',
              remark:'备注'+i
            }
          mealOrderFoodsArr.push(mealOrderFood)
          }
        let datas = {
          desk_shop_id:'1',
          person_num:'3',//加减菜不要
          total_money:'3',//总价
          user_id:'',
          dis_count_money:'3',//打折后价
          pay_type:'1',//加减菜不要
          real_money:'3',//实际价
          extra:'',//备注
          mealOrderFoods:JSON.stringify(mealOrderFoodsArr),
          type:'new'//new确认菜单，add加菜，del减菜
        }
        axios.post('/mealOrderController/updateMealOrderByDeskId.do', datas, {
              headers: {
                    'Content-Type': 'application/x-www-form-urlencoded'
              }
          })
          .then(function (response) {
            console.log(response);
          })
          .catch(function (error) {
            console.log(error);
          });
      }
    }
  })
</script>
</body>
</html>
